package com.byt.xmxb.api;

import com.byt.common.view.finder.entity.Province;
import com.byt.netapi.ApiBase;
import com.byt.netapi.bean.ResponseBean;
import com.byt.netapi.observer.BaseObserver;

import java.util.ArrayList;

public class MainApi extends ApiBase {
    private static volatile MainApi sMainApi = null;
    private MainInterface mMainInterface = null;
    protected MainApi() {
        super("");
        mMainInterface = retrofit.create(MainInterface.class);
    }

    public static MainApi getInstance(){
        if (sMainApi == null)
        synchronized (MainApi.class){
            if (sMainApi == null){
                sMainApi = new MainApi();
            }
        }
        return sMainApi;
    }

    public void getAreList(BaseObserver<ResponseBean<ArrayList<Province>>> observer){
        ApiSubscribe(mMainInterface.getAreList(), observer);
    }

}
